﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;
    using WMS6.Web.UserControls;

    public class ASNStatusRptQuery : BasePage
    {
        protected Button btnSearch;
        protected DropDownList ddlExtenalReceiptIDOper;
        protected DropDownList ddlOwnerIDOper;
        protected DropDownList ddlPOIDOper;
        protected DropDownList ddlReceiptIDOper;
        protected DropDownList ddlReceiptTypeOper;
        protected DropDownList ddlStatusOper;
        protected DropDownList ddlVendorIDOper;
        protected HtmlForm F15120;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected Label lblEndReceivedDate;
        protected Label lblExtenalReceiptID;
        protected Label lblOwnerID;
        protected Label lblPOID;
        protected Label lblReceiptID;
        protected Label lblReceiptType;
        protected Label lblStartReceivedDate;
        protected Label lblStatus;
        protected Label lblVendorID;
        protected MultipleSelectControl MSCReceiptType;
        protected MultipleSelectControl MSCStatus;
        protected HtmlLink mycss;
        protected Label one1;
        protected TextBox txtEndReceivedDate;
        protected TextBox txtExtenalReceiptID;
        protected TextBox txtOwnerID;
        protected TextBox txtPOID;
        protected TextBox txtReceiptID;
        protected TextBox txtStartReceivedDate;
        protected TextBox txtVendorID;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("ASNStatusRptList.aspx", false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlReceiptIDOper, 0);
            base.InitQueryDDL(this.ddlExtenalReceiptIDOper, 0);
            base.InitQueryDDL(this.ddlOwnerIDOper, 0);
            base.InitQueryDDL(this.ddlVendorIDOper, 0);
            base.InitQueryDDL(this.ddlReceiptTypeOper, 0);
            base.InitQueryDDL(this.ddlPOIDOper, 0);
            base.InitQueryDDL(this.ddlStatusOper, 0);
            base.BindData2DDLBySysCode(this.MSCReceiptType, "ReceiptType");
            this.ddlReceiptTypeOper.SelectedValue = "One Of";
            base.BindData2DDLBySysCode(this.MSCStatus, "ReceiptStatus");
            this.ddlStatusOper.SelectedValue = "One Of";
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.InitDropDownLists();
            }
        }

        public string Descr
        {
            get
            {
                return "";
            }
        }

        public string EndReceivedDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtEndReceivedDate.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtEndReceivedDate.Text).ToString("yyyy-MM-dd") + " 23:59:59");
                }
                return "";
            }
        }

        public string ExtenalReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExtenalReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExtenalReceiptID.Text, this.ddlExtenalReceiptIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlReceiptIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string PoID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtPOID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtPOID.Text, this.ddlPOIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptID.Text.Trim(), this.ddlReceiptIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptType
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCReceiptType.ReturnValue))
                {
                    return base.GetParamsString(this.MSCReceiptType.ReturnValue, this.ddlReceiptTypeOper.SelectedValue);
                }
                return "";
            }
        }

        public string SkuClassID
        {
            get
            {
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                return "";
            }
        }

        public string StartReceivedDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtStartReceivedDate.Text.Trim()))
                {
                    return (Convert.ToDateTime(this.txtStartReceivedDate.Text).ToString("yyyy-MM-dd") + " 00:00:00");
                }
                return "";
            }
        }

        public string Status
        {
            get
            {
                if (!string.IsNullOrEmpty(this.MSCStatus.ReturnValue))
                {
                    return base.GetParamsString(this.MSCStatus.ReturnValue, this.ddlStatusOper.SelectedValue);
                }
                return "";
            }
        }

        public string VendorID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtVendorID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtVendorID.Text, this.ddlVendorIDOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

